package utils

import (
	"interfaceTest/constant"
	"interfaceTest/model"
)

func ActivateUser(userID string) {
	url := constant.UrlDomain + "/user/active/" + userID
	client, _ := GetAdminLoginClient()
	req := model.UserActiveRequest{
		UserID: userID,
	}
	_, _ = Post(client, url, req, "application/json")
}

func BanUser(userID string) {
	url := constant.UrlDomain + "/user/ban/" + userID
	client, _ := GetAdminLoginClient()
	req := model.UserBanRequest{
		UserID: userID,
	}
	_, _ = Post(client, url, req, "application/json")
}

func AddSupervisor() {
	suffix := "/user/ms/supervisor"
	req := model.UserMsSupervisorRequest{
		UserName:          "test3",
		Name:              "yoshino",
		Age:               31,
		Password:          "e10adc3949ba59abbe56e057f20f883e",
		Gender:            "男",
		PhoneNumber:       "15822222222",
		IDNumber:          "110101199003071356",
		Department:        "CIA",
		Title:             "特工",
		Email:             "yoshino@hotmail.com",
		Qualification:     "一级",
		QualificationCode: "009",
	}
	client, _ := GetSupervisorLoginClient()
	_, _ = Put(client, constant.UrlDomain+suffix, req, "application/json")
}

func AddCounselor() {
	suffix := "/user/ms/counselor"
	req := model.UserMsCounselorRequest{
		UserName:    "test4",
		Name:        "sawamura",
		Age:         31,
		Password:    "e10adc3949ba59abbe56e057f20f883e",
		Gender:      "男",
		PhoneNumber: "15833333333",
		IDNumber:    "11010119900307731X",
		Department:  "KGB",
		Title:       "后勤",
		Email:       "sawamura@hotmail.com",
		Supervisors: []string{"2c96fecd7d45c4e2017d513364190002"},
	}
	client, _ := GetSupervisorLoginClient()
	_, _ = Put(client, constant.UrlDomain+suffix, req, "application/json")
}
